<?php
/**
 * author      :chenwenwen
 * createTime  :2020-04-06 16:14
 * description :
 */

namespace app\admin\middleware;
class Auth {
    public function handle($request, \Closure $next) {
        //前置中间件
        if (empty(session(config('admin.session_admin'))) && !preg_match('/login/',$request->pathinfo())) {
            return redirect(url('login/index'));
        }

        $response = $next($request);

        return $response;
        //后置中间件
    }

    public function end(\think\Response $response) {

    }
}